.class Lrexsee/network/RexseeBluetooth$16;
.super Ljava/lang/Thread;
.source "RexseeBluetooth.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/network/RexseeBluetooth;->connect(Ljava/lang/String;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/network/RexseeBluetooth;


# direct methods
.method constructor <init>(Lrexsee/network/RexseeBluetooth;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/network/RexseeBluetooth$16;->this$0:Lrexsee/network/RexseeBluetooth;

    .line 840
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 4

    .prologue
    .line 843
    iget-object v1, p0, Lrexsee/network/RexseeBluetooth$16;->this$0:Lrexsee/network/RexseeBluetooth;

    # getter for: Lrexsee/network/RexseeBluetooth;->mBluetoothAdapter:Landroid/bluetooth/BluetoothAdapter;
    invoke-static {v1}, Lrexsee/network/RexseeBluetooth;->access$11(Lrexsee/network/RexseeBluetooth;)Landroid/bluetooth/BluetoothAdapter;

    move-result-object v1

    invoke-virtual {v1}, Landroid/bluetooth/BluetoothAdapter;->cancelDiscovery()Z

    .line 845
    :try_start_0
    iget-object v1, p0, Lrexsee/network/RexseeBluetooth$16;->this$0:Lrexsee/network/RexseeBluetooth;

    iget-object v2, p0, Lrexsee/network/RexseeBluetooth$16;->this$0:Lrexsee/network/RexseeBluetooth;

    # getter for: Lrexsee/network/RexseeBluetooth;->mCurrentRemoteDevice:Landroid/bluetooth/BluetoothDevice;
    invoke-static {v2}, Lrexsee/network/RexseeBluetooth;->access$12(Lrexsee/network/RexseeBluetooth;)Landroid/bluetooth/BluetoothDevice;

    move-result-object v2

    # getter for: Lrexsee/network/RexseeBluetooth;->UUID_SERIAL_PORT:Ljava/util/UUID;
    invoke-static {}, Lrexsee/network/RexseeBluetooth;->access$13()Ljava/util/UUID;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/bluetooth/BluetoothDevice;->createRfcommSocketToServiceRecord(Ljava/util/UUID;)Landroid/bluetooth/BluetoothSocket;

    move-result-object v2

    invoke-static {v1, v2}, Lrexsee/network/RexseeBluetooth;->access$7(Lrexsee/network/RexseeBluetooth;Landroid/bluetooth/BluetoothSocket;)V

    .line 846
    iget-object v1, p0, Lrexsee/network/RexseeBluetooth$16;->this$0:Lrexsee/network/RexseeBluetooth;

    # getter for: Lrexsee/network/RexseeBluetooth;->mSocket:Landroid/bluetooth/BluetoothSocket;
    invoke-static {v1}, Lrexsee/network/RexseeBluetooth;->access$8(Lrexsee/network/RexseeBluetooth;)Landroid/bluetooth/BluetoothSocket;

    move-result-object v1

    invoke-virtual {v1}, Landroid/bluetooth/BluetoothSocket;->connect()V

    .line 847
    new-instance v1, Lrexsee/network/RexseeBluetooth$BluetoothConnection;

    iget-object v2, p0, Lrexsee/network/RexseeBluetooth$16;->this$0:Lrexsee/network/RexseeBluetooth;

    const/4 v3, 0x0

    invoke-direct {v1, v2, v3}, Lrexsee/network/RexseeBluetooth$BluetoothConnection;-><init>(Lrexsee/network/RexseeBluetooth;Lrexsee/network/RexseeBluetooth$BluetoothConnection;)V

    invoke-virtual {v1}, Lrexsee/network/RexseeBluetooth$BluetoothConnection;->start()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 852
    :goto_0
    return-void

    .line 848
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 849
    .local v0, "e":Ljava/io/IOException;
    iget-object v1, p0, Lrexsee/network/RexseeBluetooth$16;->this$0:Lrexsee/network/RexseeBluetooth;

    # getter for: Lrexsee/network/RexseeBluetooth;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v1}, Lrexsee/network/RexseeBluetooth;->access$1(Lrexsee/network/RexseeBluetooth;)Lrexsee/core/browser/Browser;

    move-result-object v1

    iget-object v1, v1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v2, "onBluetoothDeviceConnectFailed"

    invoke-virtual {v1, v2}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;)V

    .line 850
    iget-object v1, p0, Lrexsee/network/RexseeBluetooth$16;->this$0:Lrexsee/network/RexseeBluetooth;

    invoke-virtual {v1}, Lrexsee/network/RexseeBluetooth;->disconnect()V

    goto :goto_0
.end method
